package tcm.com.gistone.database.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import tcm.com.gistone.database.entity.Confidence;

import java.util.List;

public interface ConfidenceMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Confidence record);

    int insertSelective(Confidence record);

    Confidence selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Confidence record);

    int updateByPrimaryKey(Confidence record);

    /*批量插入总库*/
    int insertBatch(List<Confidence> list);
    /*批量插入本草库*/
    int insertBatch1(List<Confidence> list);
    /*批量插入*/
    int insertBatch2(List<Confidence> list);

    int insertBatch3(List<Confidence> list);

    @Select("select * from tb_confidence where word_Id = #{wordId} and ano_word_id = #{anoWordId} and value > #{value}")
    @ResultMap("tcm.com.gistone.database.mapper.ConfidenceMapper.BaseResultMap")
    List<Confidence> selectByValue(@Param("wordId") long wordId, @Param("anoWordId") long anoWordId, @Param("value") float value);

    /*查询一条记录*/
    @Select("select * from tb_confidence where word_Id = #{wordId} and ano_word_id = #{anoWordId}")
    @ResultMap("tcm.com.gistone.database.mapper.ConfidenceMapper.BaseResultMap")
    Confidence selectOne(@Param("wordId") long wordId, @Param("anoWordId") long anoWordId);
}